#pragma once
#ifndef __CONTROLLER_UTILITY_H_INC__
#define __CONTROLLER_UTILITY_H_INC__

#include "XCMouse.h"

namespace ControllerUtility {

	//
	// Checks whether any controllers are connected; if any
	// controllers are connected, returns the state of the
	// first one encountered
	//
	bool IsAControllerConnected(XINPUT_STATE* ret);

	//
	// Simple check of the packet numbers
	//
	bool IsStateSame(const XINPUT_STATE& first, const XINPUT_STATE& second);

	//
	// Normalizes [-32768, 32767] range to [-1, 1)
	//
	void NormalizeAnalogSticks(const XINPUT_STATE& s, float* lx, float* ly, float* rx, float* ry);

} // namespace ControllerUtility

#endif // __CONTROLLER_UTILITY_H_INC__